import React from 'react';
import {Platform} from 'react-native';
import WebView from 'react-native-webview';

class WebPageScreen extends React.PureComponent {
  static navigationOptions = ({navigation}) => ({
    headerBackTitleStyle: Platform.OS === 'ios' && {
      height: 0,
      width: 0,
    },
    title: navigation.getParam('title') || '',
  });

  render() {
    const {navigation} = this.props;
    const uri = navigation.getParam('url') || '';
    return <WebView source={{uri}} />;
  }
}

export default WebPageScreen;
